'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
    const { router, controller } = app;
    router.get('/', controller.home.index); 
    //获取左侧数据
    router.get('/api/lClassify',controller.classify.lClassify);
    //获取右侧数据
    router.get('/api/rClassify',controller.classify.rClassify);
    //获取对应分类的商品
    router.get('/api/product',controller.product.getProduct);
    //登录接口
    router.post('/api/login',controller.user.login);
    //添加订单
    router.post('/api/addOrder',controller.order.addOrder);
    //获取订单列表
    router.get('/api/orderList',controller.order.orderList);
};
